import { Controller, Get, Post, Body, Patch, Param, Delete, Sse } from '@nestjs/common';
import { PptCreateService } from './ppt-create.service';
import { CreatePptCreateDto } from './dto/create-ppt-create.dto';
import { UpdatePptCreateDto } from './dto/update-ppt-create.dto';

@Controller('ppt-create')
export class PptCreateController {
  constructor(private readonly pptCreateService: PptCreateService) {}


  @Sse('list')
  async universityList() {
   return await this.pptCreateService.getUniversityData()
  }

  @Post()
  create(@Body() createPptCreateDto: CreatePptCreateDto) {
    return this.pptCreateService.create(createPptCreateDto);
  }

  @Get()
  findAll() {
    return this.pptCreateService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.pptCreateService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updatePptCreateDto: UpdatePptCreateDto) {
    return this.pptCreateService.update(+id, updatePptCreateDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.pptCreateService.remove(+id);
  }
}
